// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import VueResource from 'vue-resource'
import VueLazyload from 'vue-lazyload'
import VuePreview from 'vue-preview'
import store from './store'

import moment from 'moment'
import 'moment/locale/zh-cn'

import MintUI from 'mint-ui'
import 'mint-ui/lib/style.css'

import './lib/mui/css/mui.min.css'
import './lib/mui/css/icons-extra.css'

Vue.config.productionTip = false

Vue.use(VueResource)
Vue.use(VuePreview)
Vue.use(VueLazyload, {
  error: require('../static/images/loading.svg'),
  loading: require('../static/images/loading.svg'),
  attempt: 1
})
Vue.use(MintUI)

Vue.filter('dateFormat', function(dataStr, pattern="YYYY-MM-DD HH:mm:ss"){
  return moment(new Date(dataStr)).format(pattern)
})
Vue.filter('listenCount', num => {
  return Math.round( num / 1000 ) / 10 + '万'
})

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  store,
  render: c => c(App)
})
